package fair.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import fair.mapper.ClassMapper;
import fair.pojo.Classes;
import fair.service.IClassService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import fair.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 班级表 服务实现类
 * </p>
 *
 * @author fair
 * @since 2021-03-04
 */
@Slf4j
@Transactional
@Service(interfaceClass = IClassService.class, version = "${dubbo.service.core.version}", group = "${dubbo.service.core.group}", retries = -1)
public class ClassServiceImpl extends ServiceImpl<ClassMapper, Classes> implements IClassService {

    @Autowired
    private ClassMapper classMapper;

    @Override
    public Classes findByName(String classname) {
        QueryWrapper<Classes> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(Classes::getClassname, classname);
        return classMapper.selectOne(queryWrapper);
    }
}
